package com.java.schedule.springbatch.listener;

import com.java.schedule.springbatch.entity.EmployeeDTO;
import org.springframework.batch.core.ItemReadListener;
import org.springframework.stereotype.Component;

@Component
public class MySecondReadListener implements ItemReadListener<EmployeeDTO> {

    private static final String name = "MySecondReadListener";

    @Override
    public void beforeRead() {
        System.out.println(name + " before read ");
    }

    @Override
    public void afterRead(EmployeeDTO item) {
        System.out.println(name + " after read item : " + item);
    }

    @Override
    public void onReadError(Exception ex) {
        System.out.println(name + " exception read exception message : " + ex.getMessage());
    }

}
